<?php

use yii\helpers\Url;

?>

<div class="row">

    <div class="col-md-12">
    	<pre>
        <code>
            switch ($v['type']) {
            	case 1 :
            		$v['type'] = '公众号';
            		$v['url']  = C('BAO_HTTPS_DOMAIN') . '/credit/?sysFlag=' . $wow . '&invite=' . $v['ident'];
            	break;
            	case 2 :
            		$v['type'] = 'App';
            		$v['url']  = $v['download'] . '?wow=' . $wow . '&ident=' . $v['ident'];
            		if (strstr($v['download'], '?')) {
            		    $v['url'] = $v['download'] . '&ident=' . $v['ident'];
            		}
            		
            		if (strlen($this->admin_user['sub_domain']) > 8) {
            			$v['url'] = str_replace('https', 'http', $v['url']);
            			$v['url'] = str_replace('bao.financesd.cn', trim($this->admin_user['sub_domain']), $v['url']);
            		}
            	break;
            	case 3 :
            		$v['type'] = 'H5';
            		$v['url']  = C('BAO_HTTPS_DOMAIN') . '/credit/?sysFlag=' . $wow . '&invite=' . $v['ident'];
            
            		//可能的替换
            		//                    $v['url'] = strlen($this->admin_user['sub_domain'])>8 ? 'http://'.trim($this->admin_user['sub_domain']).'/home1/?wow=' . $this->admin_user['weichat_id'] . '&ident=' . $v['ident'] : C('SITE_DOMAIN') . '/home1/?wow=' . $this->admin_user['weichat_id'] . '&ident=' . $v['ident'];
            	break;
            }
        </code>
        </pre>
    </div>

	<div class="col-md-12">
		
		    <div class="panel panel-primary">
        <div class="panel-heading">渠道推广</div>
        <div class="panel-body">

                <table class="table table-bordered">
                 	<thead>
                         <tr>
                        	<th>商户id</th>
                            <th>推广名称</th>
                            <th>推广标识</th>
                            <th>type<br/>1公众号2app3H5</th>
                            <th>是否开启1开启2关闭</th>
                            <th>创建时间</th>
                            <th>更新时间</th>
                            <th>推广链接</th>
                        </tr>
                	</thead>
            	<tbody>
            	<?php 
                    if ($list) :
                    foreach ($list as $key => $val) :
                ?>
                    <tr>
                    	<td><?= $val['userid']?></td>
                        <td><?= $val['name']?></td>
                        <td><?= $val['ident']?></td>
                        <td><?= $val['type']?></td>
                        <td><?= $val['is_open']?></td>
                        <td><?= $val['create_time']?></td>
                        <td><?= $val['update_time']?></td>
                        <td><?= $val['download'].'?wow=' .$business['weichat_id'] . '&ident=' . $val['ident'];?></td>
                    </tr>
                     <?php
                    endforeach;
                    endif;
                ?>
                 </tbody>
            </table>
               
                
           
        </div>
    </div>
		
		
	</div>
</div>